<?php
namespace app;


/**
 * 自定义
 */
class CustomException extends \RuntimeException
{
    protected $error;
    protected $code;

    public function __construct($error, $code)
    {   
        $this->code   = $code;
        $this->error   = $error;
        $this->message = is_array($error) ? implode(PHP_EOL, $error) : $error;
    }

    /**
     * 获取验证错误信息
     * @access public
     * @return array|string
     */
    public function getError()
    {
        return $this->error;
    }

}
